class Client
  attr_accessor :name, :os, :cpuName, :cpuBrand, :cpuNum, :cpuSpeed, :memSize, :gpuName, :gpuBrand, :gpuNum, :gpuSpeed, :gpuMemSize
  
  def initialize(name="unamed", os="", cpuName="", cpuBrand="", cpuNum=1, cpuSpeed=0, memSize=0, gpuName="", gpuBrand="", gpuNum=0, gpuSpeed=0, gpuMemSize=0)
    @name       = name
    @os         = os
    @cpuName    = cpuName
    @cpuBrand   = cpuBrand 
    @cpuNum     = cpuNum 
    @cpuSpeed   = cpuSpeed
    @memsize    = memSize
    @gpuName    = gpuName
    @gpuBand    = gpuBrand
    @gpuNum     = gpuNum
    @gpuSpeed   = gpuSpeed
    @gpuMemSize = gpuMemSize
    @firstSeen  = Time.new()
    @lastSeen   = Time.new()
  end

  #update the last seen with alive
  def isAlive
    @lastSeen = Time.new()
  end
  
  #does the client did time out ?
  
  def isTimeout    
   lastUpdate = Time.new() - @lastSeen
   puts "last update " + lastUpdate.to_i.to_s + "timeout" + $timeout.to_s 
   if(lastUpdate.to_i > $timeout)
    puts "timeouted"
    true
  else
    puts "not timeout"
    false
   end
  end

end